﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Objects;

namespace SCMS.Model
{
    public static class PurchaseOrderExtensions
    {
        public static IQueryable<PurchaseOrderItem> IncludeProjectBudget(this IQueryable<PurchaseOrderItem> queryable)
        {
            return ((ObjectQuery<PurchaseOrderItem>)queryable).Include("ProjectBudget");
        }

        public static IQueryable<PurchaseOrderItem> IncludeProjectDonor(this IQueryable<PurchaseOrderItem> queryable)
        {
            return ((ObjectQuery<PurchaseOrderItem>)queryable).Include("ProjectBudget.BudgetCategory.ProjectDonor");
        }

        public static IQueryable<PurchaseOrderItem> IncludePurchaseOrder(this IQueryable<PurchaseOrderItem> queryable)
        {
            return ((ObjectQuery<PurchaseOrderItem>)queryable).Include("PurchaseOrder");
        }
    }
}
